class Assignment {
     public Assignment next;
     public double grade;
     public Assignment(double grade) {
         next = null;
         this.grade = grade;
     }

     public Assignment(Assignment a, double grade) {
         this.next = a;
         this.grade = grade;
     }
 }

public class StudentScoreSheet implements Comparable<StudentScoreSheet> {
     private Assignment firstAssignment;
     private String studentName;


     public StudentScoreSheet(String studentName,
                              Assignment firstAssignment) {
         this.studentName = studentName;
         this. firstAssignment = firstAssignment;
     }

     public void addAssignment(Assignment newAssignment) {
         if (newAssignment == null) {
             return;
         }
         if (firstAssignment != null) {
             Assignment curr = firstAssignment;
             while (curr.next != null) {
                 curr = curr.next;
             }
             curr.next = newAssignment;
             return;
         }
         return;
     }

     public int findImprovementScore() {
         if (firstAssignment == null) {
             return 0;
         } else if (firstAssignment.next == null) {
             return 1;
         }
         int currStreak = 1;
         int maxStreak = 1;
         double previousValue = this.firstAssignment.grade;
         Assignment curr = this.firstAssignment.next;
         while (curr != null) {
             if (curr.grade <= previousValue) {
                 previousValue = curr.grade;
                 if (currStreak > maxStreak) {
                     maxStreak = currStreak;
                 }
                 currStreak = 1;
                 curr = curr.next;
             } else {
                 currStreak++;
                 previousValue = curr.grade;
                 curr = curr.next;
             }
         }
         if (currStreak > maxStreak) {
             maxStreak = currStreak;
         }
         return maxStreak;
     }


     public int compareTo(StudentScoreSheet other) {
         return (other.findImprovementScore() -
                 this.findImprovementScore());
     }
 }